package com.catmiw.stock.old2008;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

public class PropertyManager {
	private static Properties properties=new Properties();
	static {
		try {
			properties.load(PropertyManager.class.getClassLoader()
					.getResourceAsStream("com/catmiw/stock/stock_01.properties"));
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	private PropertyManager(){}
	
	public static String getProperty(String key){
		return properties.getProperty(key);
	}
	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		String fn="D:/work2009/eclipse3.5/funds/target/classes/com/catmiw/stock/stock_01.properties";
		BufferedReader fr=new BufferedReader(new FileReader(fn));
		String s=null;
		while ((s=fr.readLine())!=null){
			System.out.println(s);
		}
		fr.close();
		
		System.out.println(getProperty("SHShareIndexDiaryFile"));

	}

}
